package com.wlgc.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.io.File;

@Configuration
public class Mvc implements WebMvcConfigurer {
    @Value("${Class_Study_path.image_path}")
    String image_path;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        String path="file:"+image_path+ File.separator;
        registry.addResourceHandler("/image/**").addResourceLocations(path);
    }
}
